//
//  BallController.m
//  MyOpenGLESLearn_iOS
//
//  Created by Gaomingyang on 2021/4/14.
//

#import "BallController.h"
#import "BallRender.h"

@interface BallController ()
@property (nonatomic, strong) GLKView *glkView;
@property (nonatomic, strong) BallRender *objRender;
@end

@implementation BallController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self commonInit];
}
-(void)commonInit{
    self.title = @"圆柱形";
    self.view.backgroundColor = [UIColor whiteColor];
    EAGLContext *context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
    //是指当前的context
    [EAGLContext setCurrentContext:context];
    //2.创建GLKView 并设置代理
    self.glkView = [[GLKView alloc] initWithFrame:self.view.bounds context:context];
    self.glkView.backgroundColor = [UIColor clearColor];
    [self.view addSubview:self.glkView];
    self.objRender = [[BallRender alloc] initWithGLKView:self.glkView];
    
}
@end
